package com.salt.core.qcc.utils;

import com.alibaba.fastjson.JSONObject;
import org.apache.commons.codec.digest.DigestUtils;

/**
 * @Description
 * @Author salt
 * @Date 2022/9/13
 * @Version 1.0.1
 */
public class QccUtil {

    public static String qccToken(String key, String timeSpan, String secret) {
        return DigestUtils.md5Hex(key.concat(timeSpan).concat(secret)).toUpperCase();
    }

    public static String timeSpan() {
        return String.valueOf(System.currentTimeMillis() / 1000);
    }

    public static JSONObject getJsonObject(JSONObject object, String key) {
        return (JSONObject) object.get(key);
    }

    public static String get(JSONObject object, String key) {
        return object.get(key).toString();
    }


}
